Optimal. Leaf size=128 \[ -\frac {a^2 (5 a+6 b) \tanh ^{-1}\left (\frac {\sqrt {b} \cos (c+d x)}{\sqrt {a+b}}\right )}{2 b^{7/2} (a+b)^{3/2} d}+\frac {(2 a-b) \cos (c+d x)}{b^3 d}+\frac {\cos ^3(c+d x)}{3 b^2 d}+\frac {a^3 \cos (c+d x)}{2 b^3 (a+b) d \left (a+b-b \cos ^2(c+d x)\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.13, antiderivative size = 128, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.174, Rules used = {3265, 398, 393,
214} \begin {gather*} \frac {a^3 \cos (c+d x)}{2 b^3 d (a+b) \left (a-b \cos ^2(c+d x)+b\right )}-\frac {a^2 (5 a+6 b) \tanh ^{-1}\left (\frac {\sqrt {b} \cos (c+d x)}{\sqrt {a+b}}\right )}{2 b^{7/2} d (a+b)^{3/2}}+\frac {(2 a-b) \cos (c+d x)}{b^3 d}+\frac {\cos ^3(c+d x)}{3 b^2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 214
Rule 393
Rule 398
Rule 3265
Rubi steps
\begin {align*} \int \frac {\sin ^7(c+d x)}{\left (a+b \sin ^2(c+d x)\right )^2} \, dx &=-\frac {\text {Subst}\left (\int \frac {\left (1-x^2\right )^3}{\left (a+b-b x^2\right )^2} \, dx,x,\cos (c+d x)\right )}{d}\\ &=-\frac {\text {Subst}\left (\int \left (-\frac {2 a-b}{b^3}-\frac {x^2}{b^2}+\frac {a^2 (2 a+3 b)-3 a^2 b x^2}{b^3 \left (a+b-b x^2\right )^2}\right ) \, dx,x,\cos (c+d x)\right )}{d}\\ &=\frac {(2 a-b) \cos (c+d x)}{b^3 d}+\frac {\cos ^3(c+d x)}{3 b^2 d}-\frac {\text {Subst}\left (\int \frac {a^2 (2 a+3 b)-3 a^2 b x^2}{\left (a+b-b x^2\right )^2} \, dx,x,\cos (c+d x)\right )}{b^3 d}\\ &=\frac {(2 a-b) \cos (c+d x)}{b^3 d}+\frac {\cos ^3(c+d x)}{3 b^2 d}+\frac {a^3 \cos (c+d x)}{2 b^3 (a+b) d \left (a+b-b \cos ^2(c+d x)\right )}-\frac {\left (a^2 (5 a+6 b)\right ) \text {Subst}\left (\int \frac {1}{a+b-b x^2} \, dx,x,\cos (c+d x)\right )}{2 b^3 (a+b) d}\\ &=-\frac {a^2 (5 a+6 b) \tanh ^{-1}\left (\frac {\sqrt {b} \cos (c+d x)}{\sqrt {a+b}}\right )}{2 b^{7/2} (a+b)^{3/2} d}+\frac {(2 a-b) \cos (c+d x)}{b^3 d}+\frac {\cos ^3(c+d x)}{3 b^2 d}+\frac {a^3 \cos (c+d x)}{2 b^3 (a+b) d \left (a+b-b \cos ^2(c+d x)\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 1.07, size = 194, normalized size = 1.52 \begin {gather*} \frac {-\frac {6 a^2 (5 a+6 b) \tan ^{-1}\left (\frac {\sqrt {b}-i \sqrt {a} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {-a-b}}\right )}{(-a-b)^{3/2}}-\frac {6 a^2 (5 a+6 b) \tan ^{-1}\left (\frac {\sqrt {b}+i \sqrt {a} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {-a-b}}\right )}{(-a-b)^{3/2}}+\sqrt {b} \left (\cos (c+d x) \left (24 a-9 b+\frac {12 a^3}{(a+b) (2 a+b-b \cos (2 (c+d x)))}\right )+b \cos (3 (c+d x))\right )}{12 b^{7/2} d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.31, size = 116, normalized size = 0.91
method | result | size |
derivativedivides | \(\frac {\frac {\frac {\left (\cos ^{3}\left (d x +c \right )\right ) b}{3}+2 a \cos \left (d x +c \right )-b \cos \left (d x +c \right )}{b^{3}}-\frac {a^{2} \left (-\frac {a \cos \left (d x +c \right )}{2 \left (a +b \right ) \left (a +b -b \left (\cos ^{2}\left (d x +c \right )\right )\right )}+\frac {\left (5 a +6 b \right ) \arctanh \left (\frac {b \cos \left (d x +c \right )}{\sqrt {\left (a +b \right ) b}}\right )}{2 \left (a +b \right ) \sqrt {\left (a +b \right ) b}}\right )}{b^{3}}}{d}\) | \(116\) |
default | \(\frac {\frac {\frac {\left (\cos ^{3}\left (d x +c \right )\right ) b}{3}+2 a \cos \left (d x +c \right )-b \cos \left (d x +c \right )}{b^{3}}-\frac {a^{2} \left (-\frac {a \cos \left (d x +c \right )}{2 \left (a +b \right ) \left (a +b -b \left (\cos ^{2}\left (d x +c \right )\right )\right )}+\frac {\left (5 a +6 b \right ) \arctanh \left (\frac {b \cos \left (d x +c \right )}{\sqrt {\left (a +b \right ) b}}\right )}{2 \left (a +b \right ) \sqrt {\left (a +b \right ) b}}\right )}{b^{3}}}{d}\) | \(116\) |
risch | \(\frac {{\mathrm e}^{3 i \left (d x +c \right )}}{24 b^{2} d}+\frac {a \,{\mathrm e}^{i \left (d x +c \right )}}{b^{3} d}-\frac {3 \,{\mathrm e}^{i \left (d x +c \right )}}{8 b^{2} d}+\frac {{\mathrm e}^{-i \left (d x +c \right )} a}{d \,b^{3}}-\frac {3 \,{\mathrm e}^{-i \left (d x +c \right )}}{8 d \,b^{2}}+\frac {{\mathrm e}^{-3 i \left (d x +c \right )}}{24 b^{2} d}-\frac {a^{3} \left ({\mathrm e}^{3 i \left (d x +c \right )}+{\mathrm e}^{i \left (d x +c \right )}\right )}{b^{3} \left (a +b \right ) d \left (b \,{\mathrm e}^{4 i \left (d x +c \right )}-4 a \,{\mathrm e}^{2 i \left (d x +c \right )}-2 b \,{\mathrm e}^{2 i \left (d x +c \right )}+b \right )}-\frac {5 i a^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 i \left (a +b \right ) {\mathrm e}^{i \left (d x +c \right )}}{\sqrt {-a b -b^{2}}}+1\right )}{4 \sqrt {-a b -b^{2}}\, \left (a +b \right ) d \,b^{3}}-\frac {3 i a^{2} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 i \left (a +b \right ) {\mathrm e}^{i \left (d x +c \right )}}{\sqrt {-a b -b^{2}}}+1\right )}{2 \sqrt {-a b -b^{2}}\, \left (a +b \right ) d \,b^{2}}+\frac {5 i a^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {2 i \left (a +b \right ) {\mathrm e}^{i \left (d x +c \right )}}{\sqrt {-a b -b^{2}}}+1\right )}{4 \sqrt {-a b -b^{2}}\, \left (a +b \right ) d \,b^{3}}+\frac {3 i a^{2} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {2 i \left (a +b \right ) {\mathrm e}^{i \left (d x +c \right )}}{\sqrt {-a b -b^{2}}}+1\right )}{2 \sqrt {-a b -b^{2}}\, \left (a +b \right ) d \,b^{2}}\) | \(450\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.51, size = 154, normalized size = 1.20 \begin {gather*} \frac {\frac {6 \, a^{3} \cos \left (d x + c\right )}{a^{2} b^{3} + 2 \, a b^{4} + b^{5} - {\left (a b^{4} + b^{5}\right )} \cos \left (d x + c\right )^{2}} + \frac {3 \, {\left (5 \, a + 6 \, b\right )} a^{2} \log \left (\frac {b \cos \left (d x + c\right ) - \sqrt {{\left (a + b\right )} b}}{b \cos \left (d x + c\right ) + \sqrt {{\left (a + b\right )} b}}\right )}{{\left (a b^{3} + b^{4}\right )} \sqrt {{\left (a + b\right )} b}} + \frac {4 \, {\left (b \cos \left (d x + c\right )^{3} + 3 \, {\left (2 \, a - b\right )} \cos \left (d x + c\right )\right )}}{b^{3}}}{12 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 252 vs.
\(2 (117) = 234\).
time = 0.45, size = 529, normalized size = 4.13 \begin {gather*} \left [\frac {4 \, {\left (a^{2} b^{3} + 2 \, a b^{4} + b^{5}\right )} \cos \left (d x + c\right )^{5} + 4 \, {\left (5 \, a^{3} b^{2} + 6 \, a^{2} b^{3} - 3 \, a b^{4} - 4 \, b^{5}\right )} \cos \left (d x + c\right )^{3} - 3 \, {\left (5 \, a^{4} + 11 \, a^{3} b + 6 \, a^{2} b^{2} - {\left (5 \, a^{3} b + 6 \, a^{2} b^{2}\right )} \cos \left (d x + c\right )^{2}\right )} \sqrt {a b + b^{2}} \log \left (-\frac {b \cos \left (d x + c\right )^{2} - 2 \, \sqrt {a b + b^{2}} \cos \left (d x + c\right ) + a + b}{b \cos \left (d x + c\right )^{2} - a - b}\right ) - 6 \, {\left (5 \, a^{4} b + 11 \, a^{3} b^{2} + 6 \, a^{2} b^{3} - 2 \, a b^{4} - 2 \, b^{5}\right )} \cos \left (d x + c\right )}{12 \, {\left ({\left (a^{2} b^{5} + 2 \, a b^{6} + b^{7}\right )} d \cos \left (d x + c\right )^{2} - {\left (a^{3} b^{4} + 3 \, a^{2} b^{5} + 3 \, a b^{6} + b^{7}\right )} d\right )}}, \frac {2 \, {\left (a^{2} b^{3} + 2 \, a b^{4} + b^{5}\right )} \cos \left (d x + c\right )^{5} + 2 \, {\left (5 \, a^{3} b^{2} + 6 \, a^{2} b^{3} - 3 \, a b^{4} - 4 \, b^{5}\right )} \cos \left (d x + c\right )^{3} - 3 \, {\left (5 \, a^{4} + 11 \, a^{3} b + 6 \, a^{2} b^{2} - {\left (5 \, a^{3} b + 6 \, a^{2} b^{2}\right )} \cos \left (d x + c\right )^{2}\right )} \sqrt {-a b - b^{2}} \arctan \left (\frac {\sqrt {-a b - b^{2}} \cos \left (d x + c\right )}{a + b}\right ) - 3 \, {\left (5 \, a^{4} b + 11 \, a^{3} b^{2} + 6 \, a^{2} b^{3} - 2 \, a b^{4} - 2 \, b^{5}\right )} \cos \left (d x + c\right )}{6 \, {\left ({\left (a^{2} b^{5} + 2 \, a b^{6} + b^{7}\right )} d \cos \left (d x + c\right )^{2} - {\left (a^{3} b^{4} + 3 \, a^{2} b^{5} + 3 \, a b^{6} + b^{7}\right )} d\right )}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 322 vs.
\(2 (117) = 234\).
time = 0.55, size = 322, normalized size = 2.52 \begin {gather*} \frac {\frac {3 \, {\left (5 \, a^{3} + 6 \, a^{2} b\right )} \arctan \left (\frac {b \cos \left (d x + c\right ) + a + b}{\sqrt {-a b - b^{2}} \cos \left (d x + c\right ) + \sqrt {-a b - b^{2}}}\right )}{{\left (a b^{3} + b^{4}\right )} \sqrt {-a b - b^{2}}} + \frac {6 \, {\left (a^{3} - \frac {a^{3} {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - \frac {2 \, a^{2} b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1}\right )}}{{\left (a b^{3} + b^{4}\right )} {\left (a - \frac {2 \, a {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - \frac {4 \, b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {a {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}\right )}} - \frac {8 \, {\left (3 \, a - b - \frac {6 \, a {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {3 \, b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {3 \, a {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}\right )}}{b^{3} {\left (\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} - 1\right )}^{3}}}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.22, size = 123, normalized size = 0.96 \begin {gather*} \frac {\cos \left (c+d\,x\right )\,\left (\frac {2\,\left (a+b\right )}{b^3}-\frac {3}{b^2}\right )}{d}+\frac {{\cos \left (c+d\,x\right )}^3}{3\,b^2\,d}+\frac {a^3\,\cos \left (c+d\,x\right )}{2\,d\,\left (a+b\right )\,\left (-b^4\,{\cos \left (c+d\,x\right )}^2+b^4+a\,b^3\right )}-\frac {a^2\,\mathrm {atanh}\left (\frac {\sqrt {b}\,\cos \left (c+d\,x\right )}{\sqrt {a+b}}\right )\,\left (5\,a+6\,b\right )}{2\,b^{7/2}\,d\,{\left (a+b\right )}^{3/2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________